import {mapState} from 'vuex'
let mixins = {
  data: function () {
    return {}
  },
  computed: {
    ...mapState(['chooseDialogEnum', 'selectEnum'])
  },
  methods: {
    /**
     * 提示信息
     * @returns {string}
     */
    approveFeeAlertInfo () {
      let info = this.$store.state.checkResult
      if (info !== 'pass') {
        var mLan = this.getResource('alert.information.' + info)
        if (mLan != null && mLan !== '' && mLan !== undefined) {
          this.alert(mLan)
        } else {
          this.alert(info)
        }
        return '-1'
      }
      return '0'
    },
    /**
     * 车船费---校验税额是否超过16%
     * @param store
     * @returns {boolean}
     */
    draftTrainGridCheckNotaxamount () {
      let notaxamount = this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.notaxamount
      let tax = this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.tax
      if (notaxamount === null || notaxamount === '') {
        notaxamount = 0
      }
      if (tax === null || tax === '') {
        tax = 0
      }
      let sum = (parseFloat(notaxamount) + parseFloat(tax)).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.billssum = sum
      this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.actualremibursesum = sum
      return true
    },
    /**
     * 车船费---校验税额是否超过16%
     * @param store
     * @returns {boolean}
     */
    draftTrainGridCheckTax () {
      let notaxamount = this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.notaxamount
      let tax = this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.tax
      if (notaxamount === null || notaxamount === '') {
        notaxamount = 0
      }
      if (tax === null || tax === '') {
        tax = 0
      }
      let sum = (parseFloat(notaxamount) + parseFloat(tax)).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.billssum = sum
      this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.actualremibursesum = sum
      return true
    },
    /**
     * 车船费---校验税额是否超过16%
     * @param store
     * @returns {boolean}
     */
    approveFeeTrainGridCheckNotaxamount () {
      if (this.pageType === this.pageTypeEnum.approveFee && this.isMakeCert() === '-1') {
        this.alert(this.getResource('alert.information.yjzzbyxxg')) // 已经制证不允许修改
        return false
      }
      let notaxamount = this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.notaxamount
      let billssum = this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.billssum
      let tax = this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.tax
      if (notaxamount === null || notaxamount === '') {
        notaxamount = 0
      }
      if (tax === null || tax === '') {
        tax = 0
      }
      let sum = notaxamount * 1 + tax * 1
      if (sum > billssum) {
        // alert('实际报销金额不能大于票面金额')
        this.alert(this.getResource('alert.information.sjjebndypmje')) // 实际报销金额不能大于票面金额
        return false
      }
      this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.actualremibursesum = sum
      return true
    },
    /**
     * 车船费---校验税额是否超过16%
     * @param store
     * @returns {boolean}
     */
    approveFeeTrainGridCheckTax () {
      if (this.pageType === this.pageTypeEnum.approveFee && this.isMakeCert() === '-1') {
        this.alert(this.getResource('alert.information.yjzzbyxxg')) // 已经制证不允许修改
        return false
      }
      let notaxamount = this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.notaxamount
      let billssum = this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.billssum
      let tax = this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.tax
      if (notaxamount === null || notaxamount === '') {
        notaxamount = 0
      }
      if (tax === null || tax === '') {
        tax = 0
      }
      let sum = notaxamount * 1 + tax * 1
      if (sum > billssum) {
        this.alert(this.getResource('alert.information.sjjebndypmje')) // 实际报销金额不能大于票面金额
        return false
      }
      this.$store.state.gridSelectRow.ssc.reimburse.whBtFareDetails.actualremibursesum = sum
      return true
    },

    /**
     * 住宿费---校验税额是否超过16%
     * @param store
     * @returns {boolean}
     */
    draftHotelGridCheckNotaxamount () {
      let notaxamount = this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.notaxamount
      let tax = this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.tax
      if (notaxamount === null || notaxamount === '') {
        notaxamount = 0
      }
      if (tax === null || tax === '') {
        tax = 0
      }
      let sum = (parseFloat(notaxamount) + parseFloat(tax)).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.billssum = sum
      this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.actualremibursesum = sum
      return true
    },
    /**
     * 住宿费---校验税额是否超过16%
     * @param store
     * @returns {boolean}
     */
    draftHotelGridCheckTax () {
      let notaxamount = this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.notaxamount
      let tax = this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.tax
      if (notaxamount === null || notaxamount === '') {
        notaxamount = 0
      }
      if (tax === null || tax === '') {
        tax = 0
      }
      let sum = (parseFloat(notaxamount) + parseFloat(tax)).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.billssum = sum
      this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.actualremibursesum = sum
      return true
    },
    /**
     * 住宿费---校验税额是否超过16%
     * @param store
     * @returns {boolean}
     */
    approveFeeHotelGridCheckNotaxamount () {
      if (this.pageType === this.pageTypeEnum.approveFee && this.isMakeCert() === '-1') {
        this.alert(this.getResource('alert.information.yjzzbyxxg')) // 已经制证不允许修改
        return false
      }
      let notaxamount = this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.notaxamount
      let billssum = this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.billssum
      let tax = this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.tax
      if (notaxamount === null || notaxamount === '') {
        notaxamount = 0
      }
      if (tax === null || tax === '') {
        tax = 0
      }
      let sum = notaxamount * 1 + tax * 1
      if (sum > billssum) {
        this.alert(this.getResource('alert.information.sjjebndypmje')) // 实际报销金额不能大于票面金额
        return false
      }
      this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.actualremibursesum = sum
      return true
    },
    /**
     * 住宿费---校验税额是否超过16%
     * @param store
     * @returns {boolean}
     */
    approveFeeHotelGridCheckTax () {
      if (this.pageType === this.pageTypeEnum.approveFee && this.isMakeCert() === '-1') {
        this.alert(this.getResource('alert.information.yjzzbyxxg')) // 已经制证不允许修改
        return false
      }
      let notaxamount = this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.notaxamount
      let billssum = this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.billssum
      let tax = this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.tax
      if (notaxamount === null || notaxamount === '') {
        notaxamount = 0
      }
      if (tax === null || tax === '') {
        tax = 0
      }
      let sum = notaxamount * 1 + tax * 1
      if (sum > billssum) {
        this.alert(this.getResource('alert.information.sjjebndypmje')) // 实际报销金额不能大于票面金额
        return false
      }
      this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails.actualremibursesum = sum
      return true
    },
    /** ----待迁移----
     *检查是否已经制证 gyren
     * @param store
     * @param paramObj
     * @returns {string}
     */
    isMakeCert () {
      let certificateNo = this.$store.state.ssc.reimburse.whBtReimburseRcmSub.certificateNo
      if (certificateNo !== null && certificateNo !== '') {
        return '-1'
      }
      return '0'
    },
    /**
     * 费用岗编辑ddSub表时校验
     *
     */
    onEditCell () {
      if (this.isMakeCert() === '-1') {
        this.alert(this.getResource('alert.information.yjzzbyxxg')) // 已经制证不允许修改
        return false
      }
      let mid = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.mid
      var noTaxMoney = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.notincludetaxessum
      var taxMoney = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.taxrate
      var reimbMoney = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.reimbursesum
      var rate = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.rate

      if (noTaxMoney === null || noTaxMoney === '') {
        this.alert(this.getResource('alert.information.bhsjebnwkbnwl')) // 不含税金额不能为空
        return false
      }
      if (taxMoney === null || taxMoney === '') {
        this.alert(this.getResource('alert.information.sebnwkbnwl')) // 税额不能为空
        return false
      }
      if (noTaxMoney.length > 10) {
        this.alert(this.getResource('alert.information.bhsjedcdbncgs')) // "不含税金额长度不能超过10位!
        return false
      }
      var regExpObject = new RegExp('^[1-9][0-9]*\\.[0-9]{1,2}$|^0\\.[0-9]{1,2}$|^[1-9][0-9]*$|^0$')
      if (!regExpObject.test(noTaxMoney)) {
        this.alert(this.getResource('alert.srzqbhsje')) // 请输入正确的不含税金额
        return false
      }
      if (!regExpObject.test(taxMoney)) {
        this.alert(this.getResource('alert.srzqse')) // 请输入正确的税额
        return false
      }
      if (((noTaxMoney * 100 + taxMoney * 100) / 100) > reimbMoney * 1) {
        this.alert(this.getResource('alert.information.sjbxjebndybxje')) // 实际报销金额不能大于申请报销金额
        return false
      }
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.actualreimbursesum = ((noTaxMoney * 1) + (taxMoney * 1)).toFixed(2)
      return true
    },
    reloadRechargeMoney () {
      // 实时加载本次冲抵金额
      var amountReimTotalSum = this.$store.state.ssc.reimburse.whBtReimburseRcmSub.totalSumFee
      var unpaidaggregateamount = this.$store.state.ssc.reimburse.whBtReimburseRcmSub.unpaidAggregateAmountFee // 借款未还总金额
      // 如果报销币种与本位币相同，才允许冲抵，否则不进行冲抵；
      var standMoney = this.$store.state.ssc.reimburse.whBtReimburse.standardmoney
      var rbStandMoney = this.$store.state.ssc.reimburse.whBtReimburse.reimbStandardMoney
      // unpaidaggregateamount + '' === '0' ||
      if (standMoney !== null && standMoney !== '' && rbStandMoney != null && rbStandMoney !== '' && standMoney === rbStandMoney) {
        if (unpaidaggregateamount == null || unpaidaggregateamount + '' === '0' || unpaidaggregateamount == 0) {
          console.log('=====SAAAAAA======')
          this.$store.state.ssc.reimburse.whBtReimburseRcmSub.chargeAgainstSumFee = 0 // 本次冲抵金额
          this.$store.state.ssc.reimburse.whBtReimburseRcmSub.defraySum = amountReimTotalSum
        } else if ((unpaidaggregateamount - 0 !== 0) && (amountReimTotalSum - 0) >= (unpaidaggregateamount - 0)) {
          console.log('=====BBBBB======')
          this.$store.state.ssc.reimburse.whBtReimburseRcmSub.chargeAgainstSumFee = unpaidaggregateamount
          this.$store.state.ssc.reimburse.whBtReimburseRcmSub.defraySum = ((amountReimTotalSum - 0) - (unpaidaggregateamount - 0)).toFixed(2)
        } else if ((unpaidaggregateamount - 0 !== 0) && (amountReimTotalSum - 0) <= (unpaidaggregateamount - 0)) {
          console.log('=====CCCCC======')
          this.$store.state.ssc.reimburse.whBtReimburseRcmSub.chargeAgainstSumFee = amountReimTotalSum
          this.$store.state.ssc.reimburse.whBtReimburseRcmSub.defraySum = 0
        }
      } else {
        console.log('=====DDDDD======')
        this.$store.state.ssc.reimburse.whBtReimburseRcmSub.chargeAgainstSumFee = 0 // 本次冲抵金额
        this.$store.state.ssc.reimburse.whBtReimburseRcmSub.defraySum = amountReimTotalSum
      }
      console.log('=========', this.$store.state.ssc.reimburse.whBtReimburseRcmSub.defraySum)
      console.log('=====222======', amountReimTotalSum)
    },
    /** 不含税金额+本位币计算**/
    approveFeeVerifys () {
      if (this.pageType === this.pageTypeEnum.approveFee && this.isMakeCert() === '-1') {
        this.alert(this.getResource('alert.information.yjzzbyxxg')) // 已经制证不允许修改
        return false
      }
      let bhsje = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.notincludetaxessum // 不含税金额
      let se = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.taxrate // 税额
      let sqbxje = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.reimbursesum // 报销金额
      let sjbxje = 0.0 // 实际报销金额
      let bxje = 0 // 计算报销金额
      let hl = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.rate // 汇率
      if (bhsje == null || bhsje === '') { bhsje = 0 }
      if (se == null || se === '') { se = 0 }
      if (bxje == null || bxje === '') { bxje = 0 }
      if (sjbxje == null || sjbxje === '') { sjbxje = 0 }
      if (hl == null || hl === '') { hl = 1 }

      bxje = (bhsje * 1 + se * 1).toFixed(2)
      sjbxje = (bhsje * 1 + se * 1).toFixed(2)

      if (sqbxje * 1 < sjbxje * 1) { // 申请报销金额<实际报销金额时，提示
        this.alert(this.getResource('alert.information.sjbxjebndybxje'))// "实际报销金额不能大于申请报销金额"
        setTimeout(() => {
          this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.notincludetaxessum = 0
        }, 200)
        return false
      }
      let chgsjbxje = (sjbxje * 1 * hl).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.actualreimbursesum = sjbxje
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.chgActReimbSum = chgsjbxje
    },
    /** 税额+本位币计算**/
    approveFeeVerifytax () {
      if (this.pageType === this.pageTypeEnum.approveFee && this.isMakeCert() === '-1') {
        this.alert(this.getResource('alert.information.yjzzbyxxg')) // 已经制证不允许修改
        return false
      }
      let bhsje = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.notincludetaxessum // 不含税金额
      let se = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.taxrate // 税额
      let hl = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.rate // 汇率
      let sqbxje = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.reimbursesum // 报销金额
      if (bhsje == null || bhsje === '') { bhsje = 0 }
      if (se == null || se === '') {
        se = 0
        this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.taxrate = 0
      }
      if (hl == null || hl === '') { hl = 1 }

      if (bhsje * 1 === 0) {
        this.alert(this.getResource('alert.inputNoTax')) // 请先输入不含税金额
        setTimeout(() => {
          this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.taxrate = 0
          this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.actualreimbursesum = 0
          this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.chgActReimbSum = 0
          this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.rate = hl
        }, 200)
        return
      }

      let sjbxje = (bhsje * 1 + se * 1).toFixed(2)
      let chgsjbxje = (sjbxje * 1 * hl).toFixed(2)
      if (sqbxje * 1 < sjbxje * 1) { // 申请报销金额<实际报销金额时，提示
        this.alert(this.getResource('alert.information.sjbxjebndybxje'))// "实际报销金额不能大于申请报销金额"
        setTimeout(() => {
          this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.taxrate = 0
        }, 200)
        return false
      }
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.actualreimbursesum = sjbxje
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.chgActReimbSum = chgsjbxje
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.rate = hl
    },
    /** 不含税金额+本位币计算**/
    draftVerifys () {
      let bhsje = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.notincludetaxessum // 不含税金额
      let se = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.taxrate // 税额
      let bxje = 0.0 // 报销金额
      let sjbxje = 0.0 // 实际报销金额
      let hl = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.rate // 汇率
      if (bhsje == null || bhsje === '') { bhsje = 0 }
      if (se == null || se === '') { se = 0 }
      if (bxje == null || bxje === '') { bxje = 0 }
      if (sjbxje == null || sjbxje === '') { sjbxje = 0 }
      if (hl == null || hl === '') { hl = 1 }

      bxje = (bhsje * 1 + se * 1).toFixed(2)
      sjbxje = (bhsje * 1 + se * 1).toFixed(2)
      let chgsjbxje = (sjbxje * 1 * hl).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.reimbursesum = bxje
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.actualreimbursesum = sjbxje
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.rate = hl
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.chgReimbSum = chgsjbxje
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.chgActReimbSum = chgsjbxje
    },
    /** 税额+本位币计算**/
    draftVerifytax () {
      let bhsje = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.notincludetaxessum // 不含税金额
      let se = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.taxrate // 税额
      let bxje = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.reimbursesum // 报销金额
      let sjbxje = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.actualreimbursesum // 实际报销金额
      let hl = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.rate
      if (bhsje == null || bhsje === '') { bhsje = 0 }
      if (se == null || se === '') {
        se = 0
        this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.taxrate = 0
      }
      if (bxje == null || bxje === '') { bxje = 0 }
      if (sjbxje == null || sjbxje === '') { sjbxje = 0 }
      if (hl == null || hl === '') { hl = 1 }

      if (bhsje * 1 === 0) {
        this.alert(this.getResource('alert.inputNoTax')) // 请先输入不含税金额
        setTimeout(() => {
          this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.taxrate = 0
          this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.reimbursesum = bxje
          this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.actualreimbursesum = sjbxje
          this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.rate = hl
          this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.chgReimbSum = 0
          this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.chgActReimbSum = 0
        }, 200)
        return
      }
      bxje = (bhsje * 1 + se * 1).toFixed(2)
      sjbxje = (bhsje * 1 + se * 1).toFixed(2)
      let chgsjbxje = (sjbxje * 1 * hl).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.reimbursesum = bxje
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.actualreimbursesum = sjbxje
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.rate = hl
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.chgReimbSum = chgsjbxje
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.chgActReimbSum = chgsjbxje
    },
    noTaxAmountOnblur () {
      let noTax = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.notaxamount
      let tax = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.tax
      let rate = this.$store.state.ssc.reimburse.whBtReimburse.rate
      if (rate === null || rate === '') { rate = 1 }
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.reimbursesum = (noTax * 1 + tax * 1).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.actualreimbursesum = (noTax * 1 + tax * 1).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.notaxamountCurrency = ((noTax * 1) * (rate * 1)).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.actualreimbursesumCurrency = ((noTax * 1 + tax * 1) * (rate * 1)).toFixed(2)
      return true
    },
    taxOnblur () {
      let noTax = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.notaxamount
      let tax = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.tax
      let rate = this.$store.state.ssc.reimburse.whBtReimburse.rate
      if (rate === null || rate === '') { rate = 1 }
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.reimbursesum = (noTax * 1 + tax * 1).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.actualreimbursesum = (noTax * 1 + tax * 1).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.taxCurrency = ((tax * 1) * (rate * 1)).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.actualreimbursesumCurrency = ((noTax * 1 + tax * 1) * (rate * 1)).toFixed(2)
    },
    approveFeeNoTaxAmountOnblur () {
      let noTax = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.notaxamount
      let tax = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.tax
      let rate = this.$store.state.ssc.reimburse.whBtReimburse.rate
      if (rate === null || rate === '') { rate = 1 }
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.actualreimbursesum = (noTax * 1 + tax * 1).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.notaxamountCurrency = ((noTax * 1) * (rate * 1)).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.actualreimbursesumCurrency = ((noTax * 1 + tax * 1) * (rate * 1)).toFixed(2)
      return true
    },
    approveFeeTaxOnblur () {
      let noTax = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.notaxamount
      let tax = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.tax
      let rate = this.$store.state.ssc.reimburse.whBtReimburse.rate
      if (rate === null || rate === '') { rate = 1 }
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.actualreimbursesum = (noTax * 1 + tax * 1).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.taxCurrency = ((tax * 1) * (rate * 1)).toFixed(2)
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare.actualreimbursesumCurrency = ((noTax * 1 + tax * 1) * (rate * 1)).toFixed(2)
    },
    // 表标准日期转换为字符串
    caclDay (date) {
      let dayStr
      if (date) {
        console.log('date2====', date)
        dayStr = date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate()
      }
      return dayStr
    },
    convertDate (dateStr) {
      let dayStr = ''
      let year = dateStr.substring(0, 4) + ''
      let month = dateStr.substring(5, 7) + ''
      let day = dateStr.substring(8, 10) + ''
      dayStr = year + month + day
      return dayStr
    },
    transferTaxCertOnBlur () {
      let rate = this.$store.state.ssc.reimburse.whBtReimburse.rate
      let transferTaxBX = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseRcmDetail.transferTaxBx
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseRcmDetail.transferTaxBx = ((transferTaxBX * 1) * (rate * 1))
    },
    noTaxAmountCertOnBlur () {
      let rate = this.$store.state.ssc.reimburse.whBtReimburse.rate
      let noTaxBX = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseRcmDetail.notincludetaxessumBx
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseRcmDetail.notincludetaxessum = (noTaxBX * 1) * (rate * 1)
    },
    taxCertOnBlur () {
      let rate = this.$store.state.ssc.reimburse.whBtReimburse.rate
      let taxBX = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseRcmDetail.taxrateBx
      this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseRcmDetail.taxrate = ((taxBX * 1) * (rate * 1))
    },
    checkBeforeSave () {
      let innerOrderCode = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.internalordercode
      let subjectCode = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.subjectcode
      let reimsum = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.reimbursesum
      let actreimsum = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.actualreimbursesum
      let summary = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.summary
      let notincludetaxessum = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.notincludetaxessum
      let taxrate = this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.taxrate

      if (innerOrderCode == null || innerOrderCode === '') {
        this.alert(this.getResource('alert.information.qxxznbdd')) // 请先选择内部订单
        return false
      }
      if (subjectCode == null || subjectCode === '') {
        this.alert(this.getResource('alert.information.qxzygkmdm')) // 请先选择科目
        return false
      }
      if (reimsum == null || reimsum === '' || reimsum === undefined || reimsum * 1 === 0) {
        this.alert(this.getResource('alert.bxjebnwl')) // 报销金额不能为0
        return false
      }
      if (notincludetaxessum == null || notincludetaxessum === '') {
        notincludetaxessum = 0
        this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.notincludetaxessum = 0
      }
      if (taxrate == null || taxrate === '') {
        taxrate = 0
        this.$store.state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub.taxrate = 0
      }
      if (actreimsum == null || actreimsum === '' || actreimsum === undefined || actreimsum * 1 === 0) {
        this.alert(this.getResource('alert.information.sjbxjebnwkbnwl')) // 实际报销金额不能为0
        return false
      }
      if (actreimsum * 1 > reimsum * 1) {
        this.alert(this.getResource('alert.information.sjjebndybxje')) // 实际报销金额不能大于报销金额
        return false
      }
      if (summary == null || summary === '') {
        this.alert(this.getResource('alert.abstract')) // 请填写摘要
        return false
      }
      var regExpObject = new RegExp('^[1-9][0-9]*\\.[0-9]{1,2}$|^0\\.[0-9]{1,2}$|^[1-9][0-9]*$|^0$')
      if (!regExpObject.test(notincludetaxessum)) {
        this.alert(this.getResource('alert.srzqbhsje')) // 请输入正确不含税金额
        return false
      }
      if (!regExpObject.test(taxrate)) {
        this.alert(this.getResource('alert.srzqse')) // 请输入正确的税额
        return false
      }
      return true
    },
    /**
     * 重新计算冲减金额
     * marked by gyren 20180521
     */
    calculateAfter () {
      let totalsum = this.$store.state.ssc.reimburse.whBtReimburse.totalsum
      let chargeagainstsum = this.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum
      let unpaidaggregateamount = this.$store.state.ssc.reimburse.whBtReimburse.unpaidaggregateamount

      var reimbStandardMoney = this.$store.state.ssc.reimburse.whBtReimburse.reimbStandardMoney // 报销币别
      var standMoney = this.$store.state.ssc.reimburse.whBtReimburse.standardmoney

      if (reimbStandardMoney === standMoney) {
        if (unpaidaggregateamount === null || unpaidaggregateamount === 0) {
          this.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = 0
        } else if ((unpaidaggregateamount - 0 !== 0) && (totalsum - 0) >= (unpaidaggregateamount - 0)) {
          this.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = unpaidaggregateamount
        } else if ((unpaidaggregateamount - 0 !== 0) && (totalsum - 0) <= (unpaidaggregateamount - 0)) {
          this.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = totalsum
        } else {
          this.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = 0
        }
      } else {
        this.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = 0
      }
    },
    draftRechargeMoney () {
      var amountReimTotalSum = this.$store.state.ssc.reimburse.whBtReimburse.totalsum // 合计金额
      var unpaidaggregateamount = this.$store.state.ssc.reimburse.whBtReimburse.unpaidaggregateamount // 借款未还总金额
      // 如果报销币种与本位币相同，才允许冲抵，否则不进行冲抵；
      var standMoney = this.$store.state.ssc.reimburse.whBtReimburse.standardmoney
      var bxbb = this.$store.state.ssc.reimburse.whBtReimburse.reimbStandardMoney // 报销币别

      if (standMoney != null && standMoney !== '' && bxbb != null && bxbb !== '' && standMoney === bxbb) {
        if (unpaidaggregateamount == null || unpaidaggregateamount + '' === '0' || unpaidaggregateamount === 0) {
          this.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = 0
        } else if ((unpaidaggregateamount - 0 !== 0) && (amountReimTotalSum - 0) >= (unpaidaggregateamount - 0)) {
          this.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = unpaidaggregateamount
        } else if ((unpaidaggregateamount - 0 != 0) && (amountReimTotalSum - 0) <= (unpaidaggregateamount - 0)) {
          this.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = amountReimTotalSum
        }
      } else {
        this.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = 0
      }
    },
    chgCompanySelect () {
      // 0、检查已登记项目;
      let totalsum = this.$store.state.ssc.reimburse.whBtReimburse.totalsum
      let comCode = this.$store.state.ssc.reimburse.whBtReimburse.reimbursecompanycode
      if (totalsum !== null && totalsum !== 0.00 && comCode !== null && comCode !== '') {
        var ifcon = confirm(this.getResource('alert.xggsqcjl'))
        if (!ifcon) {
          return false
        }
      }
      return true
    },
    chgCostCenterSelect () {
      // 0、检查已登记项目;
      var totalsum = this.$store.state.ssc.reimburse.whBtReimburse.totalsum
      var costCenter = this.$store.state.ssc.reimburse.whBtReimburse.reimbursecompanycostcenter
      if (totalsum !== null && totalsum !== 0.00 && costCenter !== null && costCenter !== '') {
        var ifcon = confirm(this.getResource('alert.xgcbzxqcjl'))
        if (!ifcon) {
          return false
        }
      }
      return true
    },
    callBackBankInfo (result) {
      this.$store.state.ssc.reimburse.whBtReimburse.accountbankname = result.bankName
      this.$store.state.ssc.reimburse.whBtReimburse.accountbanknumber = result.employeeBankNo
      this.$store.state.ssc.reimburse.whBtReimburse.accountbankcode = result.bankCode
    },
    chooCurrency (value) {
      let self = this
      if (value === null || value === '') {
        self.$store.state.ssc.reimburse.whBtReimburse.rate = null // 清空汇率
      } else {
        self.$store.state.ssc.reimburse.whBtReimburse.rate = null // 清空汇率
        let bwbtemp = self.$store.state.ssc.reimburse.whBtReimburse.standardmoney
        // 如果报销币别等于本位币，直接给汇率置为1
        if (value !== bwbtemp) {
          let params1 = {}
          params1.currencyOrigin = value
          params1.currencyTarget = bwbtemp
          params1.lang = self.$store.state.lang
          params1.field1 = ''
          params1.field2 = ''
          let params = {}
          params.DT_169_BPM_ExchangeRateQuery = params1
          let success = function (data) {
            self.$store.state.ssc.reimburse.whBtReimburse.rate = data.data.data.DT_169_BPM_ExchangeRateQuery_Resp.exchangeRate + ''
          }
          let fail = function (error) {}
          coachViewUtil.callAjaxByServiceName('EBSA@AJAX_169_ExchangeRateQuery', params, success, fail)
        } else {
          self.$store.state.ssc.reimburse.whBtReimburse.rate = 1
        }
        // 更换币别后，重新计算本次冲抵金额
        var amountReimTotalSum = self.$store.state.ssc.reimburse.whBtReimburse.totalsum
        var unpaidaggregateamount = self.$store.state.ssc.reimburse.whBtReimburse.unpaidaggregateamount

        var bxbb = self.$store.state.ssc.reimburse.whBtReimburse.reimbStandardMoney
        // 重新进行金额大小判断
        if (bwbtemp === bxbb) {
          if (unpaidaggregateamount === null || unpaidaggregateamount === 0) {
            self.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = 0
          } else if ((unpaidaggregateamount - 0 !== 0) && (amountReimTotalSum - 0) >= (unpaidaggregateamount - 0)) {
            self.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = unpaidaggregateamount
          } else if ((unpaidaggregateamount - 0 !== 0) && (amountReimTotalSum - 0) <= (unpaidaggregateamount - 0)) {
            self.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = amountReimTotalSum
          }
        } else {
          self.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = 0
        }
      }
      return true
    },
    callBackCardAndBank (result) {
      console.log('call back card and bank.....')
      let self = this
      self.$store.state.ssc.reimburse.whBtReimburse.gatherupname = result.cn
      self.$store.state.ssc.reimburse.whBtReimburse.gatherupcode = result.uid
      self.$store.state.ssc.reimburse.whBtReimburse.gatherupNumber = result.employeenumber

      // 更换实际收款人后调用177接口，更新员工银行信息
      let StaffBankInfoQuery = {}
      StaffBankInfoQuery.lang = self.$store.state.lang
      StaffBankInfoQuery.employeeNo = self.$store.state.ssc.reimburse.whBtReimburse.gatherupNumber
      StaffBankInfoQuery.Field1 = ''
      StaffBankInfoQuery.Field2 = ''

      let parameters = {}
      parameters.DT_177_BPM_StaffBankInfoQuery = StaffBankInfoQuery
      let success1 = function (data) {
        if (data.data.data.DT_177_BPM_StaffBankInfoQuery_Resp.Data.items.length > 0) {
          var bankNo = data.data.data.DT_177_BPM_StaffBankInfoQuery_Resp.Data.items[0].employeeBankNo
          // $CV('local.bankCard').val({'value': bankNo, 'name': bankNo})
          self.$store.state.ssc.reimburse.whBtReimburse.accountbanknumber = bankNo
          self.$store.state.ssc.reimburse.whBtReimburse.accountbankname = data.data.data.DT_177_BPM_StaffBankInfoQuery_Resp.Data.items[0].bankName
          self.$store.state.ssc.reimburse.whBtReimburse.accountbankcode = data.data.data.DT_177_BPM_StaffBankInfoQuery_Resp.Data.items[0].bankCode
        } else {
          // 清空银行卡号和银行名称字段
          // $CV('local.bankCard').val({name: '', value: ''})
          self.$store.state.ssc.reimburse.whBtReimburse.accountbanknumber = ''
          self.$store.state.ssc.reimburse.whBtReimburse.accountbankname = ''
          self.$store.state.ssc.reimburse.whBtReimburse.accountbankcode = ''
          this.alert(this.getResource('alert.actualPayeeNoCard'))
        }
      }
      let fail1 = function (error) {
        this.alert(this.getResource('alert.getBankInfoFailed'))
      }
      coachViewUtil.callAjaxByServiceName('EBSA@AJAX_177_StaffBankInfoQuery', parameters, success1, fail1)
      return true
    },
    delReimDDSubDetails () {
      // 更换公司后，删除费用报销明细
      let self = this
      let tsId = self.$store.state.tsId
      var params = {}
      params.ts_id = tsId
      var success = function (result) {
        console.log('delReimDetails tsId:', tsId)
      }
      var fail = function (error) {}
      coachViewUtil.callAjaxByServiceName('PREXPR@AJAX_DeleteReimburseDetailsByTs_id', params, success, fail, true)
    },
    // 查询是否费用报销扫描公司，查询ISSCAN字段,并控制显隐,
    // 已经在主表上扩展isscan字段，未来不再使用，考虑到已上线，暂时不做改动。 gyren 20180814
    queryIsScanForDraft () {
      let self = this
      var companyCode = self.$store.state.ssc.reimburse.whBtReimburse.reimbursecompanycode
      var params = "{'companyCode':'" + companyCode + "'}"
      var success = function (result) {
        var ret = result.data.data.isScan
        if (ret === 'Y') {
          self.$store.state.isScan = ret
        } else {
          self.$store.state.isScan = ret
        }
      }
      var fail = function (error) {
        this.alert(this.getResource('alert.checkIsScanError'))
      }
      coachViewUtil.callAjaxByServiceName('PREXPR@AJAX_SelectCompanyByCode', params, success, fail, true)
    },
    callBackCompany (value) {
      let self = this
      // 如果公司代码为空时，则不清除已填报明细表数据。
      let comCode = self.$store.state.ssc.reimburse.whBtReimburse.reimbursecompanycode

      // 选择公司后清空相关字段
      if (comCode !== null && comCode !== '') {
        self.$store.state.ssc.reimburse.whBtReimburse.reimbursecompanycostcenter = ''
        self.$store.state.ssc.reimburse.whBtReimburse.reimbursecostcentercode = ''
        self.$store.state.ssc.reimburse.whBtReimburse.reimbStandardMoney = ''
        self.$store.state.ssc.reimburse.whBtReimburse.standardmoney = ''
        self.$store.state.ssc.reimburse.whBtReimburse.totalsum = 0.00
        self.$store.state.ssc.reimburse.whBtReimburse.folio = ''
        self.$store.state.ssc.reimburse.whBtReimburse.rate = null
        self.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = 0.00
        self.$store.state.ssc.reimburse.whBtReimburse.isscan = ''
      }
      // 所选公司信息回写
      self.$store.state.ssc.reimburse.whBtReimburse.reimbursecompanyname = value.companyname
      self.$store.state.ssc.reimburse.whBtReimburse.reimbursecompanycode = value.companycode
      self.$store.state.ssc.reimburse.whBtReimburse.reimbStandardMoney = value.standardmoney
      self.$store.state.ssc.reimburse.whBtReimburse.standardmoney = value.standardmoney
      self.$store.state.ssc.reimburse.whBtReimburse.rate = 1
      self.$store.state.ssc.reimburse.whBtReimburse.isscan = value.isscan

      // 更换公司后，重新调用166接口，加载未还款金额
      let ygbh = self.$store.state.ssc.reimburse.whBtReimburse.employeeNumber // 员工编号
      let gsdm = value.companycode// 公司代码

      var employeeLoanQuery = {}
      employeeLoanQuery.employeeNum = ygbh
      employeeLoanQuery.companyCode = gsdm
      employeeLoanQuery.lang = self.$store.state.lang
      employeeLoanQuery.btNo = ''
      employeeLoanQuery.field1 = ''
      employeeLoanQuery.field2 = ''
      employeeLoanQuery.field3 = ''

      var params1 = {}
      params1.DT_166_BPM_EmployeeLoanQuery = employeeLoanQuery
      var success1 = function (data) {
        if (data.data.data.DT_166_BPM_EmployeeLoanQuery_Resp.excuteStatus === 'S') {
          var temp1 = data.data.data.DT_166_BPM_EmployeeLoanQuery_Resp.loan
          self.$store.state.ssc.reimburse.whBtReimburse.unpaidaggregateamount = temp1
        } else {
          this.alert(data.data.data.DT_166_BPM_EmployeeLoanQuery_Resp.errorMessage)
        }
      }
      var fail1 = function (error) {
        this.alert(this.getResource('alert.info.cxygjkjksb'))
      }
      coachViewUtil.callAjaxByServiceName('EBSA@AJAX_166_EmployeeLoanQuery', params1, success1, fail1)

      // 如果原来的填报公司不为空，则删除已填的费用报销明细,
      if (comCode !== null && comCode !== '') {
        this.delReimDDSubDetails()
      }
      // 删除明细后，刷新表格
      console.log('---------------------------log a------------------------------')
      // $CV('CVPageTable1').refreshCurData()
      self.$store['_actions'].getDataFromTableDdSub[0]({me: self})
      // 更换公司后，重新准备币别参数
      console.log('---------------------------log b------------------------------')
      // setParameterForCurrency() // 确认在选公司后面实现了
      // 判断所选公司是否需要隐藏影响单据链接
      console.log('---------------------------log c------------------------------')
      this.queryIsScanForDraft()
      console.log('---------------------------log d------------------------------')
      return true
    },
    // 成本中心callback函数
    callBackCostCenter (value) {
      let self = this
      // 如果成本中心为空时，则不清除已填报明细表数据。
      var costCenter = self.$store.state.ssc.reimburse.whBtReimburse.reimbursecompanycostcenter
      self.$store.state.ssc.reimburse.whBtReimburse.reimbursecompanycostcenter = value.costCenterName
      self.$store.state.ssc.reimburse.whBtReimburse.reimbursecostcentercode = value.costCenterCode
      if (costCenter !== null && costCenter !== '') {
        // 成本中心更换，相关字段清空
        self.$store.state.ssc.reimburse.whBtReimburse.folio = ''
        self.$store.state.ssc.reimburse.whBtReimburse.totalsum = 0.00
        self.$store.state.ssc.reimburse.whBtReimburse.chargeagainstsum = 0.00
        // 如果成本中心不为空，删除已填的费用报销明细，为空时保留原有明细数据
        this.delReimDDSubDetails()
      }
      self.$store['_actions'].getDataFromTableDdSub[0]({me: self})

      return value
    },
    requriedVerifyFee () {
      var taskType = this.$store.state.task.taskType // 任务类型(0:申请,1:待办,2:加签,3:转办,4：任务池,5:流程管理替换处理人 )
      // var taskType = hsInputPara.taskType// 任务类型(0:申请,1:待办,2:加签,3:转办,4：任务池,5:流程管理替换处理人 )
      if (this.isMakeCert() === '0' && taskType !== '2') {
        this.alert(this.getResource('alert.myzzbyxtj')) // 还没有制证,不允许提交
        return false
      }
      return true
    },
    /** 差旅费明细行编辑功能校验**/
    onSubEditCell (gv, stage, rId, cInd, nValue, oValue) {
      var obj = {}
      obj.resultFlag = true
      obj.resultMes = ''

      if (this.isMakeCert() === '-1') {
        obj.resultFlag = false
        obj.resultMes = this.getResource('alert.information.yjzzbyxxg') // 已经制证不允许修改
        return obj
      }

      if (stage !== 2) {
        obj.resultFlag = true
        obj.resultMes = ''
        return obj
      }

      var regExpObject = new RegExp('^[1-9][0-9]*\\.[0-9]{1,2}$|^0\\.[0-9]{1,2}$|^[1-9][0-9]*$|^0$')
      if (!regExpObject.test(nValue)) {
        obj.resultFlag = false
        obj.resultMes = this.getResource('alert.srzqsjbxje') // 输入正确的实际报销金额
        return obj
      }
      var data
      if (gv === 'CVPageTable5') {
        // 发现都是为了获取修改的行编辑的最先值，所以这里改成直接返回选择行
        data = this.$store.state.gridSelectRow.ssc.reimburse.whBtTransportationDetails
      } else if (gv === 'StayTable') {
        // 发现都是为了获取修改的行编辑的最先值，所以这里改成直接返回选择行
        data = this.$store.state.gridSelectRow.ssc.reimburse.whBtStayDetails
      }
      // data = gv.retrieveDataByIdFromGrid(rId, true, true)
      var billssum = data.billssum// 申请报销金额
      var actReimbSum = data.actualremibursesum// 实际报销金额
      var noTaxAmount = data.notaxamount// 不含税金额
      var tax = data.tax// 税额

      if (cInd === 8) { // 修改不含税金额
        if (nValue * 1 + tax * 1 > billssum * 1) {
          obj.resultFlag = false
          obj.resultMes = this.getResource('alert.information.sjjebndypmje')// 实际报销金额不能大于票面金额
        }
      }
      if (cInd === 9) { // 修改税额
        if (nValue * 1 + noTaxAmount * 1 > billssum * 1) {
          obj.resultFlag = false
          obj.resultMes = this.getResource('alert.information.sjjebndypmje')// 实际报销金额不能大于票面金额
        }
      }
      if (cInd === 6) { // 修改出租费的实际报销金额
        if (nValue * 1 > billssum * 1) {
          obj.resultFlag = false
          obj.resultMes = this.getResource('alert.information.sjjebndypmje')// 实际报销金额不能大于票面金额
        }
      }
      return obj
    },
    openOcr () {
      let taskType = this.$store.state.task.taskType
      let ocrLink = this.$store.state.ssc.reimburse.whBtReimburse.processlinkocr
      let processlinkopentext = this.$store.state.ssc.reimburse.whBtReimburse.processlinkopentext
      if (ocrLink && processlinkopentext && taskType !== '2') {
        let ocrLinkArry = ocrLink.split(';')
        if (ocrLinkArry[0]) {
          window.open(ocrLinkArry[0], '', 'height=650,width=1150,top=0,left=1450')
        }
      }
    },
    isBlockAdvance (pinputtype) {
      switch (pinputtype) {
        case this.chooseDialogEnum.reimbursecompanyname:
        case this.chooseDialogEnum.accountBankNumber:
        case this.chooseDialogEnum.gatherupname:
        case this.chooseDialogEnum.trainlink:
        case this.chooseDialogEnum.aboardlink:
        case this.chooseDialogEnum.reimbursecompanycostcenter:
        case this.chooseDialogEnum.postcostcenter:
        case this.chooseDialogEnum.splitcostcenter:
          return true
        default:
          return false
      }
    },
    isBlockSelect (pinputtype) {
      switch (pinputtype) {
        case this.selectEnum.paymentinternalorder:
        case this.selectEnum.paymentsubject:
        case this.selectEnum.BB:
        case this.selectEnum.splitinternalorder:
        case this.selectEnum.splitsubject:
        case this.selectEnum.postsubject:
          return true
        default:
          return false
      }
    },
    advanceDialogType (pselectType) {
      switch (pselectType) {
        case this.chooseDialogEnum.reimbursecompanyname:
        case this.chooseDialogEnum.accountBankNumber:
          return 'simplechoose'
        case this.chooseDialogEnum.gatherupname:
          return 'personchoose'
        case this.chooseDialogEnum.trainlink:
        case this.chooseDialogEnum.aboardlink:
          return 'taskchoose'
        case this.chooseDialogEnum.reimbursecompanycostcenter:
        case this.chooseDialogEnum.postcostcenter:
        case this.chooseDialogEnum.splitcostcenter:
          return 'commonchoose'
        default:
          return ''
      }
    },
    advanceTranslateDic (pselectType) {
      switch (pselectType) {
        case this.chooseDialogEnum.reimbursecompanyname:
          return {
            value: 'companycode',
            name: 'companyname'
          }
        case this.chooseDialogEnum.accountBankNumber:
          return {
            value: 'employeeBankNo',
            name: 'employeeBankNo'
          }
        case this.chooseDialogEnum.gatherupname:
          return {
            value: 'uid',
            name: 'cn'
          }
        case this.chooseDialogEnum.trainlink:
        case this.chooseDialogEnum.aboardlink:
          return {
            value: 'btNo',
            name: 'btNo'
          }
        case this.chooseDialogEnum.reimbursecompanycostcenter:
        case this.chooseDialogEnum.postcostcenter:
        case this.chooseDialogEnum.splitcostcenter:
          return {
            value: 'costCenterCode',
            name: 'costCenterName'
          }
        default:
          return {}
      }
    }
  }
}
export default mixins
